<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LLMResearch WebUI</title>
    <link rel="stylesheet" href="/static/css/main.css">
    <link rel="stylesheet" href="/static/css/themes.css">
    <script src="https://cdn.socket.io/4.4.1/socket.io.min.js"></script>
</head>
<body class="theme-light">
    <div class="app-container">
        <header class="app-header">
            <h1>LLMResearch</h1>
            <div class="header-controls">
                <button id="settings-toggle" class="icon-button" title="Settings">
                    <span class="icon">⚙️</span>
                </button>
                <button id="theme-toggle" class="icon-button" title="Toggle Theme">
                    <span class="icon">🌓</span>
                </button>
            </div>
        </header>
        
        <main class="app-main">
            <div class="chat-container">
                <div class="chat-messages" id="chat-messages">
                    <!-- Messages will be dynamically added here -->
                    <div class="message system">
                        <div class="message-content">
                            欢迎使用 LLMResearch WebUI。有什么可以帮助您的吗？
                        </div>
                    </div>
                </div>
                
                <div class="chat-input">
                    <textarea id="user-input" placeholder="输入您的消息..."></textarea>
                    <div class="input-controls">
                        <button id="file-button" class="icon-button" title="上传文件">
                            <span class="icon">📎</span>
                        </button>
                        <button id="send-button">发送</button>
                    </div>
                </div>
            </div>
            
            <div class="settings-panel" id="settings-panel">
                <h3>设置</h3>
                
                <div class="setting-group">
                    <label for="provider-select">LLM 提供商:</label>
                    <select id="provider-select">
                        <option value="openai">OpenAI</option>
                        <option value="custom">自定义</option>
                    </select>
                </div>
                
                <div class="setting-group">
                    <label for="web-search-toggle">网络搜索:</label>
                    <input type="checkbox" id="web-search-toggle" checked>
                </div>
                
                <div class="setting-group">
                    <label for="extract-url-toggle">提取 URL 内容:</label>
                    <input type="checkbox" id="extract-url-toggle" checked>
                </div>
                
                <div class="setting-group">
                    <label for="reasoning-steps">推理步骤:</label>
                    <input type="number" id="reasoning-steps" min="1" max="10" value="5">
                </div>
                
                <div class="setting-group">
                    <label for="temperature">温度:</label>
                    <input type="range" id="temperature" min="0" max="1" step="0.1" value="0.7">
                    <span id="temperature-value">0.7</span>
                </div>
                
                <div class="setting-group">
                    <button id="clear-history">清除聊天历史</button>
                </div>
                
=======
            </div>
        </main>
        
        <div class="file-upload-modal" id="file-upload-modal">
            <div class="modal-content">
                <h3>上传文件</h3>
                <form id="file-upload-form">
                    <input type="file" id="file-input">
                    <div class="modal-buttons">
                        <button type="button" id="cancel-upload">取消</button>
                        <button type="submit">上传</button>
                    </div>
                </form>
            </div>
        </div>
        
        <div class="reasoning-modal" id="reasoning-modal">
            <div class="modal-content">
                <h3>多步骤推理</h3>
                <div class="reasoning-form">
                    <div class="form-group">
                        <label for="reasoning-task">任务:</label>
                        <textarea id="reasoning-task" placeholder="输入您想要解决的任务..."></textarea>
                    </div>
                    <div class="form-group">
                        <label for="reasoning-steps-input">步骤数:</label>
                        <input type="number" id="reasoning-steps-input" min="1" max="10" value="5">
                    </div>
                    <div class="modal-buttons">
                        <button type="button" id="cancel-reasoning">取消</button>
                        <button type="button" id="start-reasoning">开始推理</button>
                    </div>
                </div>
                <div class="reasoning-progress" id="reasoning-progress" style="display: none;">
                    <h4>推理进度</h4>
                    <div class="progress-container">
                        <div class="progress-bar" id="reasoning-progress-bar"></div>
                    </div>
                    <div class="progress-status" id="reasoning-status">准备中...</div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="/static/js/api.js"></script>
    <script src="/static/js/chat.js"></script>
    <script src="/static/js/settings.js"></script>
    <script src="/static/js/reasoning.js"></script>
    <script src="/static/js/app.js"></script>
</body>
</html>